package com.shixi.shixitraining.shixitraining.ui.tabmine.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.RequestManager;
import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.test.TestCollectTrainingBean;
import com.shixi.shixitraining.shixitraining.ui.tabhome.activity.OverseaApplyActivity;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseAdapter;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseRecycleHolder;

import java.util.List;

/**
 * Created by shenyan on 2018/7/19.
 */

public class CollectTrainingAdapter  extends BaseAdapter<TestCollectTrainingBean> implements View.OnClickListener {

private  RequestManager manager;
    public CollectTrainingAdapter(Context context, List<TestCollectTrainingBean> data, RequestManager manager) {
        super(context, data);
        this.manager=manager;
    }

    @Override
    public void convert(BaseRecycleHolder holder, TestCollectTrainingBean item, int position) {
        holder.setText(R.id.title_tv,item.getTitle());
        holder.setText(R.id.address_tv,item.getCity());
        holder.setText(R.id.offical_tv,item.getDays());
        holder.setText(R.id.time_tv,item.getTimes());
        TextView mApplyTv = holder.getView(R.id.tv_immediately_apply);
        mApplyTv.setOnClickListener(this);

    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.adapter_mine_collect_training;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_immediately_apply:
                mContext.startActivity(new Intent(mContext, OverseaApplyActivity.class));
                break;
        }
    }
}
